//package cn.flying.cloud.esb.core.camel.process;
//
//import org.apache.camel.Exchange;
//import org.apache.camel.Processor;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.context.ApplicationContext;
//
//import cn.flying.cloud.esb.core.camel.constants.CamelConstant;
//import cn.flying.cloud.esb.entity.EbAtomicService;
//import cn.flying.cloud.esb.model.ApiRequest;
//import cn.flying.cloud.esb.service.EbAtomicServiceService;
//
///**
// * 转发地址解析处理器
// *
// * @author: admin
// * @date: 2025年04月10日 16:46
// * @version: 1.0
// */
//public class ForwardResolverProcessor implements Processor {
//    private final Logger logger = LoggerFactory.getLogger(this.getClass());
//
//    private ApplicationContext applicationContext;
//
//    public ForwardResolverProcessor(ApplicationContext applicationContext) {
//        this.applicationContext = applicationContext;
//    }
//
//    @Override
//    public void process(Exchange exchange) throws Exception {
//        ApiRequest request = exchange.getProperty(CamelConstant.API_REQUEST, ApiRequest.class);
//        EbAtomicServiceService atomicServiceService = applicationContext.getBean(EbAtomicServiceService.class);
//        EbAtomicService ebAtomicService = new EbAtomicService();
//        ebAtomicService.setServiceCode(request.getRequest().getHead().getServiceCode());
//        ebAtomicService.setStatus("Y");
//        ebAtomicService = atomicServiceService.getOneObj(ebAtomicService);
//
//        // 查询转发地址
//        String forwardUrl = "http://localhost:10005/test/tt?bridgeEndpoint=true";
////        String forwardUrl = ebAtomicService.getServiceUri();
//        logger.info("转发地址：【{}】", forwardUrl);
//
//        // 设置转发地址到消息头
//        exchange.getIn().setHeader("forwardUrl", forwardUrl);
//
////        使用 exchange 存储局部变量
////        exchange.setProperty("forwardUrl", forwardUrl);
//    }
//}
